package com.zeng.springcloudapp;

import com.zeng.springcloud.config.ConfigDefaultPropertySourceLocator;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.core.env.Environment;

@SpringBootApplication
public class SpringCloudAppApplication {
    @Bean
    public static ConfigDefaultPropertySourceLocator configDefaultPropertySourceLocator() {
        return new ConfigDefaultPropertySourceLocator();
    }


    @Bean
    public ApplicationRunner runner(Environment environment) {
        return (args) -> System.out.println("参数读取 age:" + environment.getProperty("my.age"));

    }

    public static void main(String[] args) {
        SpringApplication.run(SpringCloudAppApplication.class, args);
    }

}
